package com.cy.store.util;

import lombok.Data;

import java.io.Serializable;

/**
 * @PROJECT_NAME: store
 * @DESCRIPTION:
 * @USER: 28416
 * @DATE: 2022/11/2 20:12
 *
 * JSON数据进行响应
 */
@Data
public class JsonResult<E>   implements Serializable {
    /**
     * 状态码
     */
    private  Integer state;

    /**
     *
     */
    private String message;

    /**
     *
     */

    private  E data;

    public JsonResult(Integer state) {
        super();
        this.state = state;
    }

    public JsonResult(Throwable e) {
        super();
        this.message = e.getMessage();
    }

    public JsonResult() {
        super();
    }
    public JsonResult(Integer state,E data){
        super();
        this.state = state;
        this.data = data;
    }
}
